<?php

namespace Mallocu\NuitInfoBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;

/**
 * Mallocu\NuitInfoBundle\Admin\ImageAdmin
 * 
 * @author Rémi PIOTAIX <remi.piotaix@gmail.com>
 */
class ImageAdmin extends Admin {

    protected function configureFormFields(FormMapper $formMapper) {
        $formMapper
                ->add('file', 'file', array(
                    'required' => false
                        )
                )
        //->add('nom')
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper) {
        $datagridMapper
                ->add('nom')
        ;
    }

    protected function configureListFields(ListMapper $listMapper) {
        $listMapper
                ->addIdentifier('nom')
                ->add('monument')
        ;
    }

    public function validate(ErrorElement $errorElement, $object) {
//        $errorElement
//            ->with('name')
//                ->assertMaxLength(array('limit' => 32))
//            ->end()
//        ;
    }

}

?>
